﻿<UserControl x:Class="Kiosk.UserControls.PresentationPresenter"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Background="Transparent"  >
    <UserControl.Resources>
        <Storyboard x:Key="showVideoSlide" >
            <!-- Grow Video-->
            <DoubleAnimation Storyboard.TargetName="vidSlide"
                             Storyboard.TargetProperty="Opacity" From=".25" To="1" Duration="0:0:1.25" />
            <DoubleAnimation Storyboard.TargetName="vidScale"
                             Storyboard.TargetProperty="ScaleY"  From="0" To="1" Duration="0:0:1.25" />
            <DoubleAnimation Storyboard.TargetName="vidScale"
                             Storyboard.TargetProperty="ScaleX" From="0" To="1" Duration="0:0:1.25" />
            <DoubleAnimation Storyboard.TargetName="vidRotate" Storyboard.TargetProperty="Angle" From="0" To="720" Duration="0:0:1.25" />
            <!-- Drop slides -->
            <DoubleAnimation Storyboard.TargetName="imgSlide1"
                             Storyboard.TargetProperty="Opacity" FillBehavior="HoldEnd" To="0" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transDrop1" FillBehavior="Stop"
                             Storyboard.TargetProperty="Y" From="0" To="200" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale1"
                             Storyboard.TargetProperty="ScaleY" From="1" To=".8" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale1"
                             Storyboard.TargetProperty="ScaleX" From="1" To=".8" Duration="0:0:0.75" />

            <DoubleAnimation Storyboard.TargetName="imgSlide2"
                             Storyboard.TargetProperty="Opacity" FillBehavior="HoldEnd" To="0" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transDrop2" FillBehavior="Stop"
                             Storyboard.TargetProperty="Y" From="0" To="200" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale2"
                             Storyboard.TargetProperty="ScaleY" From="1" To=".8" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale2"
                             Storyboard.TargetProperty="ScaleX" From="1" To=".8" Duration="0:0:0.75" />

        </Storyboard>
        <Storyboard x:Key="hideVideoSlide" >
            <!-- Drop Video-->
            <DoubleAnimation Storyboard.TargetName="vidSlide"
                             Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="vidDrop" FillBehavior="Stop"
                             Storyboard.TargetProperty="Y" From="0" To="200" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="vidScale"
                             Storyboard.TargetProperty="ScaleY" From="1" To=".8" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="vidScale"
                             Storyboard.TargetProperty="ScaleX" From="1" To=".8" Duration="0:0:0.75" />
        </Storyboard>


        <Storyboard x:Key="showSlide1" >
            <!-- Grow slide 1-->
            <DoubleAnimation Storyboard.TargetName="imgSlide1"
                             Storyboard.TargetProperty="Opacity" From=".25" To="1" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale1"
                             Storyboard.TargetProperty="ScaleY"  From=".5" To="1" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale1"
                             Storyboard.TargetProperty="ScaleX" From=".5" To="1" Duration="0:0:0.75" />
            <!-- Drop slide 2-->
            <DoubleAnimation Storyboard.TargetName="imgSlide2"
                             Storyboard.TargetProperty="Opacity" FillBehavior="HoldEnd" To="0" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transDrop2" FillBehavior="Stop"
                             Storyboard.TargetProperty="Y" From="0" To="200" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale2"
                             Storyboard.TargetProperty="ScaleY" From="1" To=".8" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale2"
                             Storyboard.TargetProperty="ScaleX" From="1" To=".8" Duration="0:0:0.75" />

        </Storyboard>
        <Storyboard x:Key="showSlide2" FillBehavior="Stop" >
            <!-- Grow slide 2-->
            <DoubleAnimation Storyboard.TargetName="imgSlide2"
                             Storyboard.TargetProperty="Opacity" From=".25" To="1" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale2"
                             Storyboard.TargetProperty="ScaleY"  From=".5" To="1" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale2"
                             Storyboard.TargetProperty="ScaleX" From=".5" To="1" Duration="0:0:0.75" />
            <!-- Drop slide 1-->
            <DoubleAnimation Storyboard.TargetName="imgSlide1"
                             Storyboard.TargetProperty="Opacity" FillBehavior="HoldEnd" To="0" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transDrop1" FillBehavior="Stop"
                             Storyboard.TargetProperty="Y" From="0" To="200" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale1"
                             Storyboard.TargetProperty="ScaleY" From="1" To=".8" Duration="0:0:0.75" />
            <DoubleAnimation Storyboard.TargetName="transScale1" 
                             Storyboard.TargetProperty="ScaleX"  From="1" To=".8" Duration="0:0:0.75" />

        </Storyboard>

    </UserControl.Resources>
            <Grid Name="grdImages">
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>

        <MediaElement  Name="vidSlide" Margin="15"  Grid.Row="0" Grid.Column="0" ClipToBounds="True"    Stretch="Uniform" StretchDirection="Both" RenderTransformOrigin=".5,.5" 
            LoadedBehavior="Manual" UnloadedBehavior="Manual" MediaOpened="vidSlide_MediaOpened" MediaFailed="vidSlide_MediaFailed" MediaEnded="vidSlide_MediaEnded"  >
            <MediaElement.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1" x:Name="vidScale" ></ScaleTransform>
                    <TranslateTransform X="0" Y="0" x:Name="vidDrop" ></TranslateTransform>
                    <RotateTransform x:Name="vidRotate" Angle="0" ></RotateTransform>
                </TransformGroup>
            </MediaElement.RenderTransform>
        </MediaElement>
        <Image Grid.Row="0" Grid.Column="0" ClipToBounds="True" Source="images\placeholder.png"  Stretch="Uniform"  Margin="20" Name="imgSlide1" RenderTransformOrigin=".5,.5">
                    <Image.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="1" x:Name="transScale1" ></ScaleTransform>
                            <TranslateTransform X="0" Y="0" x:Name="transDrop1" ></TranslateTransform>
                        </TransformGroup>
                    </Image.RenderTransform>
                </Image>
                <Image Grid.Row="0" Grid.Column="0" ClipToBounds="True" Source="images\placeholder.png" Stretch="Uniform" Margin="20" Name="imgSlide2" RenderTransformOrigin=".5,.5">
                    <Image.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1" ScaleY="1" x:Name="transScale2" ></ScaleTransform>
                            <TranslateTransform X="0" Y="0" x:Name="transDrop2" ></TranslateTransform>
                        </TransformGroup>
                    </Image.RenderTransform>
                </Image>

            </Grid>
</UserControl>
